//
//  LogonOperation.m
//  PlayBall
//
//  Created by Edward Zhang on 12-5-21.
//  Copyright (c) 2012年 __MyCompanyName__. All rights reserved.
//

#import "JddLogonOperation.h"
#import "JddParameterBuilder.h"

@implementation JddLogonOperation

@synthesize userName;
@synthesize userPassword;

- (void)main{
    JddNetDataCommunication *netDataCommunication = [[JddNetDataCommunication alloc] init];
    
    NSString *bodyString = [JddParameterBuilder logonParameterWithUserName:self.userName userPassword:self.userPassword];
    
    NSData *dataLogon = [netDataCommunication requestDataByPostBodyData:[bodyString dataUsingEncoding:NSUTF8StringEncoding]];
    //NSString *resultString = [[NSString alloc] initWithData:dataLogon encoding:NSUTF8StringEncoding];
    [((NSObject*)self.delegate) performSelectorOnMainThread:@selector(LogonOperationResult:) withObject:dataLogon waitUntilDone:NO];    
}

@end
